Function Executing Device with Two Types of Wireless Communication Interfaces

ABSTRACT

A function executing device is configured to send a wireless identifier to a communication device via a first type of wireless communication interface for setting up a wireless connection. The function executing device is configured to determine whether the function executing device is in an error state and, if not, to establish the wireless connection via a second type of wireless communication interface. The function executing device operates in a parent state in the wireless connection. Additionally, print data may be received from the communication device. However, if the function executing device is in an error state the wireless connection is not established via the second type of wireless communication interface.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.16/299,640 filed Mar. 12, 2019, which is a continuation of U.S. patentapplication Ser. No. 15/691,214 filed Aug. 30, 2017, issued as U.S. Pat.No. 10,282,153 on May 7, 2019, which is a continuation of U.S. patentapplication Ser. No. 15/283,829 filed Oct. 3, 2016, issued as U.S. Pat.No. 9,781,299 on Oct. 3, 2017, which is a continuation of U.S. patentapplication Ser. No. 14/706,368 filed May 7, 2015, which is acontinuation of U.S. patent application Ser. No. 13/834,423 filed Mar.15, 2013, issued as U.S. Pat. No. 9,106,781 on Aug. 11, 2015, whichclaims priority to Japanese Patent Application No. 2012-082818, filed onMar. 30, 2012, the contents of which are hereby incorporated byreference into the present application.

TECHNICAL FIELD

A technique disclosed in the present specification relates to a functionexecuting device.

DESCRIPTION OF RELATED ART

A a technique for two communication devices to execute wirelesscommunication is known. The two communication devices executecommunication of a wireless setting according to a short-range wirelesscommunication system (i.e., a wireless communication according to NFC(abbreviation of: Near Field Communication)). The wireless setting is asetting for executing wireless communication according to acommunication system different from the NFC system (e.g., IEEE 802.11a,802.11b). Thereby, the two communication devices become capable ofexecuting wireless communication according to the wireless setting.

SUMMARY

The present specification presents a function executing device capableof executing an appropriate operation.

The technique disclosed in the specification is a function executingdevice. The function executing device may comprise a first type ofinterface for executing a communication with a terminal device, a secondtype of interface for executing a communication with the terminaldevice. The function executing device may comprise one or moreprocessors and a memory that stores computer-readable instructionstherein. The computer-readable instructions, when executed by the one ormore processors, may cause the function executing device to execute: (a)receiving first information including an execution request of a specificfunction via the first type of interface, the specific functionincluding a communication process for communicating object data with theterminal device; (b) determining, in a case where the first informationis received, whether a state of the function executing device is anon-error state in which the function executing device is capable ofexecuting the specific function or an error state in which the functionexecuting device is not capable of executing the specific function; (c)executing a change process for changing an interface for communicatingwith the terminal device from the first type of interface to the secondtype of interface in a case where the state of the function executingdevice is determined as the non-error state, and not executing thechange process in a case where the state of the function executingdevice is determined as the error state; and (d) executing the specificfunction including the communication process via the second type ofinterface in a case where the change process is being executed.

The specification further discloses a function executing device capableof executing a plurality of functions including a first function and asecond function. The function executing device may comprise a first typeof interface for executing a communication with a terminal device and asecond type of interface for executing a communication with the terminaldevice. The function executing device may comprise one or moreprocessors and a memory that stores computer-readable instructionstherein. The computer-readable instructions, when executed by the one ormore processors, may cause the function executing device to execute: (h)storing, in a memory of the function executing device, permissioninformation indicating, for each of the first function and the secondfunction, whether or not the terminal device is capable of using thefunction; (i) receiving first information including an execution requestof a specific function via the first type of interface, the specificfunction including a communication process for communicating object datawith the terminal device; (j) determining whether or not the terminaldevice is capable of using the specific function using the permissioninformation in the memory in a case where the first information isreceived; (k) executing a change process for changing an interface forcommunicating with the terminal device from the first type of interfaceto the second type of interface in a first case where it is determinedthat the specific function is the first function and the terminal deviceis capable of using the first function, and not executing the changeprocess in a second case where it is determined that the specificfunction is the second function and the terminal device is not capableof using the second function; and (l) executing the specific functionincluding the communication process via the second type of interface ina case where the change process is executed.

Moreover, a control method, a computer program, and a non-transitorycomputer-readable storage medium computer-readable instructions thefunction executing device, are also novel and useful. Further, acommunication system including the function executing device and theterminal device are also novel and useful.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows the configuration of a communication system.

FIG. 2 shows a flowchart of an MFP process.

FIG. 3 shows a flowchart of a normal request process.

FIG. 4 shows a flowchart of a re-request process.

FIG. 5 shows a flowchart of a change process.

FIG. 6 shows a sequence view of a case A.

FIG. 7 shows a sequence view of a case X1.

FIG. 8 shows a sequence view of a case X2.

FIG. 9 shows a sequence view of a case X3.

FIG. 10 shows a sequence view of a case X4.

FIG. 11 shows a sequence view of a case B.

FIG. 12 shows a sequence view of a case C. and

FIG. 13 shows a sequence view of a case D.

EMBODIMENT

(Configuration of Communication System)

As shown in FIG. 1, a communication system 2 comprises a multi-functionperipheral (called “MFP” (abbreviation of: Multi-Function Peripheral)below) 10, a portable terminal 50, an access point (called “AP” below)6, and a PC 8. The MFP 10 and the portable terminal 50 are capable ofexecuting short-range wireless communication. The short-range wirelesscommunication is according to the wireless communication NFC system. Inthe present embodiment, the wireless communication is executed accordingto the NFC system based on international standards ISO/IEC 21481 or18092.

Further, the PC8, MFP 10, and the portable terminal 50 are each capableof executing wireless communication according to the Wi-Fi Direct system(to be described). Below, Wi-Fi Direct is called “WFD”. In WFD, wirelesscommunication is executed based on IEEE (abbreviation of: The Instituteof Electrical and Electronics Engineers, Inc.) 802.11 standard andstandards based on thereon (e.g., 802.11a, 11b, 11g, 11n, etc.). The NFCsystem and the system of WFD (called “WFD system” below) have differentwireless communication systems (i.e., wireless communication standards).Further, the communication speed of wireless communication according tothe WFD system is faster than the communication speed of wirelesscommunication according to the NFC system.

For example, the MFP 10 can construct a WFD network by establishing aconnection with the portable terminal 50 according to the WFD system(called “WFD connection” below). Similarly, the MFP 10 can construct aWFD network by establishing a WFD connection with the PC 8.

The PC 8, the MFP 10 and the portable terminal 50 are further capable ofexecuting wireless communication according to a normal Wi-Fi systemdifferent from the WFD system. In general terms, wireless communicationaccording to normal Wi-Fi is wireless communication using the AP 6, andwireless communication according to the WFD system is wirelesscommunication not using the AP 6. For example, the MFP 10 can belong toa normal Wi-Fi network by establishing a connection with the AP 6(called “normal Wi-Fi connection” below) according to normal Wi-Fi. Viathe AP 6, the MFP 10 can execute wireless communication with anotherdevice belonging to the normal Wi-Fi network (e.g., the PC 8, theportable terminal 50). Moreover, the NFC system and the system of normalWi-Fi (called “the normal Wi-Fi system” below) have different wirelesscommunication systems (i.e., wireless communication standards). Further,the communication speed of normal Wi-Fi is faster than the communicationspeed of NFC.

(WFD)

WFD is a standard formulated by Wi-Fi Alliance. WFD is described in“Wi-Fi Peer-to-Peer (P2P) Technical Specification Version 1.1”, createdby Wi-Fi Alliance.

As described above, the PC 8, the MFP 10, and the portable terminal 50are each capable of executing wireless communication according to theWFD system. Below, an apparatus capable of executing wirelesscommunication according to the WFD system is called a “WFD-compatibleapparatus”. According to the WFD standard, three states are defined asthe states of the WFD-compatible apparatus: Group Owner state (called“G/O state” below), client state, and device state. The WFD-compatibleapparatus is capable of selectively operating in one state among thethree states.

One WFD network includes an apparatus in the G/O state and an apparatusin the client state. Only one G/O state apparatus can be present in theWFD network, but one or more client state apparatuses can be present.The G/O state apparatus manages the one or more client stateapparatuses. Specifically, the G/O state apparatus creates anadministration list in which identification information (i.e., MACaddress) of each of the one or more client state apparatuses is written.When a client state apparatus newly belongs to the WFD network, the G/Ostate apparatus adds the identification information of that apparatus tothe administration list, and when the client state apparatus leaves theWFD network, the G/O state apparatus deletes the identificationinformation of that apparatus from the administration list.

The G/O state apparatus is capable of wirelessly communicating objectdata (e.g., data that includes network layer information of the OSIreference model (print data, scan data, etc.)) with an apparatusregistered in the administration list, i.e., with a client stateapparatus (i.e., an apparatus belonging to the WFD network). However,with an unregistered apparatus which is not registered in theadministration list, the G/O state apparatus is capable of wirelesslycommunicating data for the unregistered apparatus to participate in theWFD network (e.g., data that does not include network layer information(physical layer data such as a Probe Request signal, Probe Responsesignal, etc.)), but is not capable of wirelessly communicating theobject data. For example, the MFP 10 that is in the G/O state is capableof wirelessly receiving print data from the portable terminal 50 that isregistered in the administration list (i.e., the portable terminal 50that is in the client state), but is not capable of wirelessly receivingprint data from an apparatus that is not registered in theadministration list.

Further, the G/O state apparatus is capable of relaying the wirelesscommunication of object data (print data, scan data, etc.) between aplurality of client state apparatuses. For example, in a case where theportable terminal 50 that is in the client state is to wirelessly sendprint data to another printer that is in the client state, the portableterminal 50 first wirelessly sends the print data to the MFP 10 that isin the G/O state. In this case, the MFP 10 wirelessly receives the printdata from the portable terminal 50, and wirelessly sends the print datato the other printer. That is, the G/O state apparatus is capable ofexecuting the function of an AP of the normal wireless network.

Moreover, a WFD-compatible apparatus that does not belong to the WFDnetwork (i.e., an apparatus not registered in the administration list)is a device state apparatus. The device state apparatus is capable ofwirelessly communicating data for belonging to the WFD network (physicallayer data such as a Probe Request signal, Probe Response signal, etc.),but is not capable of wirelessly communicating object data (print data,scan data, etc.) via the WFD network.

Moreover, below, an apparatus that is not capable of executing wirelesscommunication according to the WFD system, but is capable of executingwireless communication according to normal Wi-Fi is called a“WFD-incompatible apparatus”. The “WFD-incompatible apparatus” may alsobe called a “legacy apparatus”. A WFD-incompatible apparatus cannotoperate in the G/O state. A G/O state apparatus can registeridentification information of the WFD-incompatible apparatus in theadministration list.

(Configuration of MFP 10)

The MFP 10 comprises an operating unit 12, a displaying unit 14, a printexecuting unit 16, a scan executing unit 18, a wireless LAN interface(an “interface” is described as “I/F” below) 20, an NFC I/F 22, and acontrol unit 30. The operating unit 12 includes a plurality of keys. Auser can input various instructions to the MFP 10 by operating theoperating unit 12. The displaying unit 14 is a display for displayingvarious types of information. The print executing unit 16 is an ink jetsystem, laser system, etc. printing mechanism. The scan executing unit18 is a CCD, CIS, etc. scanning mechanism.

The wireless LAN I/F 20 is an interface for the control unit 30 toexecute wireless communication according to the WFD system and wirelesscommunication according to normal Wi-Fi. The wireless LAN I/F 20 isphysically one interface. However, a MAC address used in wirelesscommunication according to the WFD system (called “MAC address for WFD”below) and a MAC address used in wireless communication according tonormal Wi-Fi (called “MAC address for normal Wi-Fi” below) are bothassigned to the wireless LAN I/F 20. More specifically, the MAC addressfor the normal Wi-Fi is pre-assigned to the wireless LAN I/F 20. Usingthe MAC address for the normal Wi-Fi, the control unit 30 creates theMAC address for WFD, and assigns the MAC address for WFD to the wirelessLAN I/F 20. The MAC address for WFD differs from the MAC address for thenormal Wi-Fi. Consequently, via the wireless LAN I/F 20, the controlunit 30 can simultaneously execute both wireless communication accordingto the WFD system and wireless communication according to the normalWi-Fi. Consequently, a situation can be established in which the MFP 10belongs to the WFD network and belongs to the normal Wi-Fi network.Moreover, in a variant, an interface for executing wirelesscommunication according to the WFD system and an interface for executingwireless communication according to normal Wi-Fi may be configured bychips which are physically different.

Moreover, the G/O state apparatus can write, in the administration list,not only the identification information of the WFD-compatible apparatusthat is in the client state, but also the identification information ofa WFD-incompatible apparatus. That is, the G/O state apparatus can alsoestablish the WFD connection with the WFD-incompatible apparatus. Ingeneral terms, the WFD connection is a wireless connection in which theMAC address for the WFD of the MFP 10 is used. Further, the WFD networkis a wireless network in which the MAC address for the WFD of the MFP 10is used. Similarly, the normal Wi-Fi connection is a wireless connectionin which the MAC address for the normal Wi-Fi of the MFP 10 is used.Further, the normal Wi-Fi network is a wireless network in which the MACaddress for the normal Wi-Fi of the MFP 10 is used.

Moreover, by operating the operating unit 12, the user can change thesetting of the wireless LAN I/F 20 between a setting capable ofexecuting the wireless communication in accordance with the WFD system(expressed as “WFD I/F setting is ON” below), and a setting not capableof executing the wireless communication in accordance with the WFDsystem (expressed as “WFD I/F setting is OFF” below). The control unit30 stores a value (ON or OFF) indicating the WFD I/F setting set by theuser in the memory 34.

The NFC I/F 22 is an interface for the control unit 30 to executewireless communication according to the NFC system. The NFC I/F 22 isformed of a chip differing physically from the wireless LAN I/F 20.

Moreover, the communication speed of wireless communication via thewireless LAN I/F 20 (e.g., maximum communication speed is 11 to 454Mbps) is faster than the communication speed of wireless communicationvia the NFC I/F 22 (e.g., maximum communication speed is 100 to 424Kbps). Further, the frequency of the carrier wave in wirelesscommunication via the wireless LAN I/F 20 (e.g., 2.4 GHz band, 5.0 GHzband) differs from the frequency of the carrier wave in the wirelesscommunication via the NFC I/F 22 (e.g., 13.56 MHz band). Further, in acase where the distance between the MFP 10 and the portable terminal 50is less than or equal to approximately 10 cm, the control unit 30 canwirelessly communicate with the portable terminal 50 according to theNFC system via the NFC I/F 22. In a case where the distance between theMFP 10 and the portable terminal 50 is either less than or equal to 10cm, or is greater than or equal to 10 cm (e.g., a maximum isapproximately 100 m), the control unit 30 can wirelessly communicate,via the wireless LAN I/F 20, with the portable terminal 50 according tothe WFD system and according to the normal Wi-Fi. That is, the maximumdistance across which the MFP 10 can execute wireless communication witha communication destination apparatus (e.g., the portable terminal 50)via the wireless LAN I/F 20 is greater than the maximum distance acrosswhich the MFP 10 can execute the wireless communication with thecommunication destination apparatus via the NFC I/F 22.

The control unit 30 comprises a CPU 32 and the memory 34. The CPU 32executes various processes according to programs stored in the memory34. The CPU 32 realizes the functions of the units 40 to 47 by executingprocesses according to the programs.

The memory 34 includes a ROM, RAM, hard disk, etc. The memory 34 storesthe programs executed by the CPU 32. In the case where the MFP 10currently belongs to a WFD network, the memory 34 stores informationindicating that the MFP 10 currently belongs to the WFD network, and awireless setting (including authentication method, encryption method,password, SSID (Service Set Identifier) and BSSID (Basic Service SetIdentifier) of the wireless network) for communicating object data(e.g., print data, scan data) via the WFD network. Further, in the casewhere the MFP 10 currently belongs to a normal Wi-Fi network, the memory34 stores information indicating that the MFP 10 currently belongs tothe normal Wi-Fi network, and a wireless setting for communicatingobject data via the normal Wi-Fi network. Moreover, the SSID is anidentifier for identifying the wireless network, and the BSSID is aunique identifier (e.g., MAC address) of the access point (i.e., the G/Ostate apparatus in the case of the WFD network) that constructs thewireless network.

The memory 34 further stores a value (ON or OFF) indicating the WFD I/Fsetting. Moreover, in a state where the WFD I/F setting is OFF withinthe memory 34, the control unit 30 cannot execute processes inaccordance with the WFD system (e.g., a process of setting the MFP 10 tospontaneous G/O mode (to be described), G/O negotiation, etc.). In astate where the WFD I/F setting is ON, the memory 34 further stores avalue indicating the current state of the MFP 10 relating to the WFDsystem (one state from among G/O state, client state, or device state).

Moreover, by operating the operating unit 12, the user can set the MFP10 to spontaneous G/O mode. Spontaneous G/O mode is a mode formaintaining the operation of the MFP 10 in the G/O state. The memory 34further stores a value indicating whether the MFP 10 has been set tospontaneous G/O mode. Moreover, when a WFD-compatible apparatus that isin the device state is to establish a WFD connection with anotherWFD-compatible apparatus that is in the device state, the WFD-compatibleapparatus usually executes G/O negotiation to selectively determinewhich state, of G/O state and client state, it is to operate in. In thecase where the MFP 10 has been set to the spontaneous G/O mode, the MFP10 maintains operation in the G/O state without executing G/Onegotiation.

The memory 34 further stores SFL (Secure Function Lock) information 36.The SFL information 36 includes, for each of a plurality of terminaldevices including the portable terminal 50, ID-function information inwhich the following are associated: an ID of the terminal device (e.g.an ID 50), information (OK or NG) indicating whether the terminal deviceis capable of using the print function, and information (OK or NG)indicating whether the terminal device is capable of using the scanfunction. Moreover, the SFL information 36 further includes publicinformation in which the following are associated: informationindicating that the device is a public terminal device (i.e., a terminaldevice in which an ID is not registered in the ID-function information),information (NG) indicating that the terminal device is not capable ofusing the print function, and information (NG) indicating that theterminal device is not capable of using the scan function. By operatingthe operating unit 12, the user of the MFP 10 inputs the SFL information36 to the MFP 10. Thereby, the storing control unit 44 stores, in thememory 34, the SFL information 36 input by the user.

(Configuration of Portable Terminal 50)

The portable terminal 50 is, for example, a mobile phone (e.g., a SmartPhone), PDA, notebook PC, tablet PC, portable music playback device,portable video playback device, etc. The portable terminal 50 comprisesa wireless LAN I/F (i.e., an interface for WFD and normal Wi-Fi) and anNFC I/F. Consequently, the portable terminal 50 is capable of executingwireless communication with the MFP 10 by using a wireless LAN, and iscapable of executing wireless communication with the MFP 10 by using theNFC I/F. The PC 8 comprises an application program for causing the MFP10 to execute a function (e.g., print function, scan function, etc.).Moreover, the application program may, for example, be installed on theportable terminal 50 from a server provided by a vendor of the MFP 10,or may be installed on the portable terminal 50 from a media shippedtogether with the MFP 10.

(Configuration of PC 8)

The PC 8 comprises a wireless LAN I/F (i.e., an interface for WFD andnormal Wi-Fi), but does not comprise an NFC I/F. Consequently, the PC 8is capable of executing communication with the MFP 10 by using awireless LAN, but is not capable of executing wireless communicationaccording to the NFC system. The portable terminal 50 comprises a driverprogram for causing the MFP 10 to execute a function (e.g., printfunction, scan function, etc.). Moreover, the driver program is usuallyinstalled on the PC 8 from a media shipped together with the MFP 10.However, in a variant, the driver program may be installed on the PC 8from a server provided by the vendor of the MFP 10.

(Configuration of AP 6)

The AP 6 is not a G/O state apparatus of the WFD system, but is a normalaccess point called a wireless access point or wireless LAN router. TheAP 6 can establish a normal Wi-Fi connection with a plurality ofapparatuses. Thereby, a normal Wi-Fi network including the AP 6 and theplurality of apparatuses is constructed. The AP 6 receives data from oneapparatus from among the plurality of apparatuses belonging to thenormal Wi-Fi network, and sends the data to another one apparatus fromamong the plurality of apparatuses. That is, the AP 6 relayscommunication between a pair of apparatuses belonging to the normalWi-Fi network.

(Process Executed by MFP 10)

A process executed by the MFP 10 will be described with reference toFIG. 2. When a power source of the MFP 10 is turned ON, the control unit30 executes the process of FIG. 2. While the power source of the MFP 10is ON, the NFC I/F 22 assumes a state of detecting a device capable ofexecuting wireless communication according to the NFC system.

The user of the portable terminal 50 activates the application program.Next, the user inputs, to the portable terminal 50, an instruction forcausing the MFP 10 to execute a function (print function or scanfunction). In this case, the portable terminal 50 creates NFCinformation. As will be described in detail later, in the case where theportable terminal 50 receives NG information from the MFP 10 afterhaving sent the NFC information to the MFP 10, the portable terminal 50can re-create and send the NFC information. The NFC information of thefirst time includes at least information indicating a normal request,information indicating a function input by the user (print function orscan function), and the ID “ID 50” of the portable terminal 50. The NFCinformation of the second time includes, instead of the informationindicating a normal request, information indicating a re-request.Further, the NFC information of the second time includes at least afunction input by the user (print function or scan function), and the ID“ID 50” of the portable terminal 50. Moreover, in the case where thefunction input by the user is the print function (i.e., in the casewhere the NFC information of the second time includes informationindicating the print function), the NFC information of the second timefurther includes size information indicating the data size of the printdata.

Further, in the case where the portable terminal 50 currently belongs toa wireless network, the NFC information further includes the SSID andBSSID of the wireless network. Moreover, the case where the portableterminal 50 currently belongs to a wireless network is a case where awireless connection, this being at least one of a WFD connection and anormal Wi-Fi connection, has been established between the portableterminal 50 and another device (e.g., the AP 6, the MFP 10).

The user of the portable terminal 50 can bring the portable terminal 50closer to the MFP 10. Thereby, when the distance between the portableterminal 50 and the MFP 10 becomes less than the distance (e.g., 10 cm)in which the radio waves can be transmitted to each other, the NFC I/F22 receives a detection wave from the MFP 10, and sends a response waveto the MFP 10. Then, the control unit 30 executes communication with theportable terminal 50, via the NFC I/F 22, to establish an NFCcommunication session between the MFP 10 and the portable terminal 50.When the NFC communication session has been established, the portableterminal 50 sends the created NFC information to the MFP 10.

In S10 the receiving unit 40 monitors whether NFC information isreceived from the portable terminal 50 via the NFC I/F 22. In the casewhere the NFC information is received (YES in S10), in S12 the receivingunit 40 analyzes the NFC information, and determines whether the NFCinformation includes information indicating a normal request, orincludes information indicating a re-request. In the case of determiningthat the NFC information includes information indicating a normalrequest, the process proceeds to the normal request process of S14. Inthe case of determining that the NFC information includes informationindicating a re-request, the process proceeds to the re-request processof S16.

(Normal Request Process; FIG. 3)

The contents of the normal request process executed in S14 of FIG. 2will be described with reference to FIG. 3. In S40 the control unit 30analyzes the NFC information, and determines whether the NFC informationincludes information indicating the print function or includesinformation indicating the scan function. In the case of determiningthat the NFC information includes information indicating the printfunction, the process proceeds to S42. In the case of determining thatthe NFC information includes information indicating the scan function,the process proceeds to S48.

In S42 the usage determining unit 45 determines whether the portableterminal 50 is capable of using the print function. Specifically, theusage determining unit 45 first analyzes the NFC information, andidentifies the terminal ID “ID 50” included in the NFC information.Next, the usage determining unit 45 refers to the ID-functioninformation of the SFL information 36 within the memory 34, anddetermines whether the print function associated with the terminal ID“ID 50” is OK or NG. In the case where the print function is OK, theusage determining unit 45 determines YES in S42, and the processproceeds to S44. In the case where the print function is NG, the usagedetermining unit 45 determines NO in S42, and the process proceeds toS46. Moreover, in the case where the terminal ID “ID 50” is notregistered in the ID-function information, the usage determining unit 45refers to the public information of the SFL information 36 (printfunction=NG, scan function=NG), and determines NO in S42.

In S44 the state determining unit 41 determines whether the state of theMFP 10 is a print capable state (i.e., the non-error state) or a printincapable state (i.e., the error state). Specifically, the statedetermining unit 41 checks the remaining amount of an expendable itemmounted on the print executing unit 16 and, in the case where theremaining amount of the expendable item is zero, determines that thestate of the MFP 10 is the print incapable state (NO in S44). Moreover,e.g., in the case where the print executing unit 16 is an inkjet typeprinting mechanism, the expendable item is ink within an ink cartridge.Further, e.g., in the case where the print executing unit 16 is a lasertype printing mechanism, the expendable item is toner within a tonercartridge.

Further, the state determining unit 41 checks the remaining amount ofprint medium to be used by the print executing unit 16 (i.e., theremaining amount of print medium in a paper feed tray) and, in the casewhere the remaining amount of print medium is zero, determines that thestate of the MFP 10 is the print incapable state (NO in S44).

Next, the state determining unit 41 checks the state of hardware forexecuting the print function and, in a case where there is a problem inthe hardware, determines that the state of the MFP 10 is the printincapable state (NO in S44). For example, in the case where the printmedium is jammed in a transport mechanism of the print medium within theprint executing unit 16 (i.e., the case of a paper jam), the statedetermining unit 41 determines that the state of the MFP 10 is the printincapable state. In this case, the hardware is the transport mechanismof the print medium within the print executing unit 16. Further, e.g.,in a case where an amount of space within the memory 34 is extremelysmall, i.e., in the case where the amount of space within the memory 34is less than a predetermined value, the print data cannot be processed,and consequently the state determining unit 41 determines that the stateof the MFP 10 is the print incapable state. In this case, the hardwareis the memory 34. Further, e.g., in the case where, from among aplurality of members constituting a housing of the MFP 10, a covermember that must remain closed during printing is open (called “coveropen” below), the state determining unit 41 determines that the state ofthe MFP 10 is the print incapable state. In this case, the hardware isthe cover member.

In the case where, due to a problem in any of the remaining amount of anexpendable item, the remaining amount of print medium, or the state ofthe hardware, the state determining unit 41 determines that the state ofthe MFP 10 is the print incapable state (NO in S44), the processproceeds to S46. On the other hand, in the case where there is noproblem in the remaining amount of an expendable item, the remainingamount of print medium, or the state of the hardware, the statedetermining unit 41 determines that the state of the MFP 10 is the printcapable state (YES in S44). Thus, in the present embodiment, the MFP 10can appropriately determine whether the state of the MFP 10 is thenon-error state or the error state. In the case of YES in S44, thenormal request process of FIG. 3 ends as “normal END”.

In S46 the sending unit 46 sends print NG information including the NGreason due to SFL to the portable terminal 50 via the NFC I/F 22. Forexample, in the case of NO in S42, the NG reason indicates that theportable terminal 50 is not capable of using the print function.Further, in the case of NO in S44, the NG reason indicates that thestate of the MFP 10 is the error state. In this case, the NG reasonindicates the specific reason why the state of the MFP 10 is the errorstate (e.g., remaining amount of an expendable item is zero, remainingamount of the print medium is zero, print medium is jammed (paper jam),amount of space of the memory 34 is small, cover open, etc.). Thus, inthe present embodiment, the MFP 10 can appropriately notify the portableterminal 50 that the state of the MFP 10 is the print incapable state(i.e., the error state) and the reason of the error. In the case whereS46 has ended, the normal request process of FIG. 3 ends as “error END”.

In S48, the usage determining unit 45 determines whether the portableterminal 50 is capable of using the scan function. Specifically, as inS42, the usage determining unit 45 refers to the SFL information 36within the memory 34, and determines whether the scan functionassociated with the terminal ID “ID 50” is OK or NG. In the case wherethe scan function is OK, the usage determining unit 45 determines YES inS48, and the process proceeds to S52. In the case where the scanfunction is NG, the usage determining unit 45 determines NO in S48, andthe process proceeds to S50. Moreover, in the case where the terminal ID“ID 50” is not registered in the ID-function information, the usagedetermining unit 45 refers to the public information (print function=NG,scan function=NG) of the SFL information 36, and determines NO in S48.

In S50 the sending unit 46 sends scan NG information including the NGreason due to SFL to the portable terminal 50 via the NFC I/F 22. The NGreason indicates that the portable terminal 50 is not capable of usingthe scan function. In the case where S50 has ended, the normal requestprocess of FIG. 3 ends as “error END”.

In S52 the state determining unit 41 determines whether the state of theMFP 10 is a scan capable state (i.e., the non-error state) or a scanincapable state (i.e., the error state). Specifically, the statedetermining unit 41 checks the state of hardware for executing the scanfunction and, in the case where there is a problem in the hardware,determines that the state of the MFP 10 is the scan incapable state (NOin S52). For example, in the case where a document is jammed in anautomatic document feeder in the scan executing unit 18, the statedetermining unit 41 determines that the state of the MFP 10 is the scanincapable state. In this case, the hardware is the automatic documentfeeder in the scan executing unit 18. Further, e.g., in the case wherethe amount of space within the memory 34 is extremely small, i.e., inthe case where the amount of space within the memory 34 is less than apredetermined value, the scan data cannot be processed, and consequentlythe state determining unit 41 determines that the state of the MFP 10 isthe scan incapable state. In this case, the hardware is the memory 34.Further, e.g., in the case where, from among a plurality of membersconstituting the housing of the MFP 10, a cover member that must remainclosed during scanning is open (i.e., the case of “cover open”), thestate determining unit 41 determines that the state of the MFP 10 is thescan incapable state. In this case, the hardware is the cover member.

In the case where the state determining unit 41 determines that thestate of the MFP 10 is the scan incapable state (NO in S52), the processproceeds to S54. On the other hand, in the case where there is noproblem in the state of the hardware, the state determining unit 41determines that the state of the MFP 10 is the scan capable state (YESin S52). Thus, in the present embodiment, the MFP 10 can appropriatelydetermine whether the state of the MFP 10 is the non-error state or theerror state. In the case of YES in S52, the normal request process ofFIG. 3 ends as “normal END”.

In S54 the sending unit 46 determines whether the MFP 10 currentlybelongs to a wireless network. Specifically, in the case where at leastone of information indicating that the MFP 10 currently belongs to a WFDnetwork and information indicating that the MFP 10 currently belongs toa normal Wi-Fi network is being stored in the memory 34, the sendingunit 46 determines that the MFP 10 currently belongs to a wirelessnetwork (YES in S54), and proceeds to S56. On the other hand, in thecase where information indicating that the MFP 10 currently belongs to aWFD network or information indicating that the MFP 10 currently belongsto a normal Wi-Fi network is not being stored in the memory 34, thesending unit 46 determines that the MFP 10 does not belong to a wirelessnetwork (NO in S54), and proceeds to S60.

In S56 the sending unit 46 determines whether the MFP 10 and theportable terminal 50 belong to an identical wireless network.Specifically, the sending unit 46 first analyzes the NFC information,and determines whether the NFC information includes a SSID and a BSSID.In the case where the NFC information does not include a SSID and aBSSID, the portable terminal 50 does not belong to a wireless network.Consequently, the sending unit 46 determines that the MFP 10 and theportable terminal 50 do not belong to an identical wireless network (NOin S56), and proceeds to S60.

In the case where the NFC information includes the SSID and BSSID, thesending unit 46 further determines whether the SSID in the NFCinformation (i.e., the SSID of the wireless network (the normal Wi-Finetwork or WFD network) to which the portable terminal 50 belongs) andthe SSID included in the wireless setting within the memory 34 (i.e.,the SSID of the wireless network (the normal Wi-Fi network or WFDnetwork) to which the MFP 10 belongs) are identical. In the case wherethe two SSIDs are not identical, the sending unit 46 determines that theMFP 10 and the portable terminal 50 do not belong to an identicalwireless network (NO in S56), and proceeds to S60.

In the case where the two SSIDs are identical, the sending unit 46further determines whether the BSSID in the NFC information (i.e., theBSSID of the wireless network to which the portable terminal 50 belongs)and the BSSID included in the wireless setting within the memory 34(i.e., the BSSID of the wireless network to which the MFP 10 belongs)are identical. In the case where the two BSSIDs are not identical, thesending unit 46 determines that the MFP 10 and the portable terminal 50do not belong to an identical wireless network (NO in S56), and proceedsto S60.

In the case where the two BSSIDs are identical, the sending unit 46determines that the MFP 10 and the portable terminal 50 belong to anidentical wireless network (YES in S56), and proceeds to S58. Asdescribed above, in the present embodiment, the determination of whetherthe SSIDs are identical and the determination of whether the BSSIDs areidentical are both executed in S56. For example, one AP could constructa plurality of wireless networks by using a plurality of SSIDs.Consequently, in the case where the BSSIDs are identical and the SSIDsare not identical, the MFP 10 and the portable terminal 50 could belongto different wireless networks constructed by the same AP. In thepresent embodiment, it is possible to determine more appropriatelywhether the MFP 10 and the portable terminal 50 belong to the identicalwireless network by executing both the determination of whether theSSIDs are identical and the determination of whether the BSSIDs areidentical. Moreover, in a variant, in S56, the determination of whetherthe SSIDs are identical may be executed, but the determination ofwhether the BSSIDs are identical may not be executed.

In S58 and S60 the sending unit 46 sends scan NG information includingthe NG reason to the portable terminal 50 via the NFC I/F 22. The NGreason indicates the specific reason why the state of the MFP 10 is theerror state (e.g., document is jammed, amount of space in the memory 34is small, cover open, etc.). Thus, in the present embodiment, the MFP 10can appropriately notify the portable terminal 50 that the state of theMFP 10 is the scan incapable state (i.e., the error state), and thereason of the error.

Moreover, the scan NG information sent in S58 further includesinformation indicating that the MFP 10 and the portable terminal 50belong to an identical wireless network (called “NW identicalinformation” below). On the other hand, the scan NG information sent inS60 further includes information indicating that the MFP 10 and theportable terminal 50 do not belong to an identical wireless network(called “NW non-identical information” below). In the case where S58 andS60 have ended, the normal request process of FIG. 3 ends as “errorEND”. Moreover, in the case where the normal request process of FIG. 3(S14 of FIG. 2) ends, the process proceeds to S18 of FIG. 2.

Upon receiving the print NG information from the MFP 10 (see S46 of FIG.3), the portable terminal 50 executes the processes below. The portableterminal 50 first analyzes the print NG information and identifies theNG reason. For example, in the case where the NG reason indicates thatthe portable terminal 50 is not capable of using the print function (thecase of NO in S42 of FIG. 3), the portable terminal 50 displays a screenon a displaying unit of the portable terminal 50, this indicating thatthe user is not capable of using the print function, without sending theNFC information including information indicating a re-request (the NFCinformation of the second time) to the MFP 10. Further, e.g., in thecase where the NG reason indicates that the amount of space of thememory 34 is small, the portable terminal 50 displays a screen, thisindicating a shortage of the amount of space within the memory 34 of theMFP 10, on the displaying unit of the portable terminal 50 withoutsending the NFC information including information indicating are-request to the MFP 10.

On the other hand, in the case where the NG reason indicates anotherreason (e.g., remaining amount of the expendable item is zero, remainingamount of the print medium is zero, print medium is jammed (paper jam),cover open, etc.), the portable terminal 50 creates NFC information (theNFC information of the second time) including at least informationindicating a re-request, information indicating the print function, theterminal ID “ID 50”, and the size information indicating the data sizeof the print data, and sends the NFC information to the MFP 10.

Further, upon receiving the scan NG information from the MFP 10 (seeS50, S58, S60 of FIG. 3), the portable terminal 50 executes theprocesses below. The portable terminal 50 first analyzes the scan NGinformation and identifies the NG reason. For example, in the case wherethe NG reason indicates that the portable terminal 50 is not capable ofusing the scan function (S50 of FIG. 3), the portable terminal 50displays a screen indicating that the user is not capable of using thescan function on the displaying unit of the portable terminal 50 withoutsending the NFC information including information indicating are-request (the NFC information of the second time) to the MFP 10.Further, e.g., in the case where the NG reason indicates that the amountof space of the memory 34 is small, the portable terminal 50 displays ascreen, this indicating a shortage of the amount of space within thememory 34 of the MFP 10, on the displaying unit of the portable terminal50 without sending the NFC information including information indicatinga re-request to the MFP 10.

On the other hand, in the case where the NG reason indicates anotherreason (e.g., document jammed, cover open, etc.), the portable terminal50 further analyzes the scan NG information, and determines whether thescan NG information includes NW identical information (S58 of FIG. 3) orNW non-identical information (S60 of FIG. 3). In the case where the scanNG information includes the NW non-identical information, the portableterminal 50 displays a screen on the displaying unit of the portableterminal 50, this indicating that the error state is due to the NGreason, without sending the NFC information including informationindicating a re-request (the NFC information of the second time) to theMFP 10. On the other hand, in the case where the scan NG informationincludes the NW identical information, the portable terminal 50 createsNFC information including information indicating a re-request (the NFCinformation of the second time), and sends the NFC information to theMFP 10.

As described above, the portable terminal 50 can send the NFCinformation of the second time to the MFP 10 in accordance with thecontents of the print NG information or scan NG information. Moreover,in the case where the NG reason in the print NG information or scan NGinformation indicates that the portable terminal 50 is not capable ofusing the print function or the scan function, or in the case where theNG reason indicates that the amount of space of the memory 34 is small,the MFP 10 cannot execute the print function or the scan function inaccordance with the request from the portable terminal 50. Consequently,in this type of case, the portable terminal 50 does not send the NFCinformation of the second time to the MFP 10. Thereby, the MFP 10 doesnot need to receive the NFC information of the second time, andconsequently does not need to execute various processes (e.g., are-request process (to be described), a change process (to bedescribed), etc. (S16, S20 of FIG. 2, etc.)). Consequently, theprocessing load of the MFP 10 can be reduced.

Moreover, as will be described in detail later, in the case where theMFP 10 and the portable terminal 50 do not belong to an identicalwireless network, a state in which the MFP 10 and the portable terminal50 belong to an identical wireless network (called “NW identical state”below) can be formed temporarily (see S118 of FIG. 5) in the changeprocess (to be described) (see S20 of FIG. 2). In the print function,the print process is executed after a communication process (i.e.,sending of print data) has been executed. Consequently, in the casewhere the MFP 10 is in the error state in which printing cannot beexecuted, a temporary NW identical state is formed by the change process(to be described), and the MFP 10 first executes a communication process(i.e., sending of print data) by using the temporary NW identical state,and then the print process can be executed in a print monitoring thread(to be described) after the temporary NW identical state has beenterminated (i.e., after the WFD I/F has been turned OFF in S30 of FIG.2). On the other hand, in the scan function, a communication process(i.e., sending of scan data) is executed after the scan process has beenexecuted. Consequently, in the case where the MFP 10 is in the errorstate in which scanning cannot be executed, the MFP 10 cannot execute acommunication process unless the error state is resolved. Consequently,in the case where the MFP 10 is in the error state in which scanningcannot be executed, even if a temporary NW identical state is formed bythe change process (to be described), the MFP 10 cannot execute acommunication process by using the temporary NW identical state.

In view of the above circumstances, in the case where the scan NGinformation includes the NW identical information, i.e., in the casewhere it is not necessary to form a temporary NW identical state by thechange process (to be described) because the MFP 10 and the portableterminal 50 belong to an identical wireless network, the portableterminal 50 sends the NFC information of the second time to the MFP 10.However, in the case where the scan NG information includes the NWnon-identical information, i.e., in the case where it is necessary toform a temporary NW identical state by the change process (to bedescribed), the portable terminal 50 does not send the NFC informationof the second time to the MFP 10. Thereby, the MFP 10 does not need toreceive the NFC information of the second time, and consequently doesnot need to execute various processes (e.g., the re-request process (tobe described), the change process (to be described), etc. (S16, S20 ofFIG. 2, etc.)). Consequently, the processing load of the MFP 10 can bereduced.

(Re-Request Process; FIG. 4)

The contents of the re-request process executed in S16 of FIG. 2 will bedescribed with reference to FIG. 4. In S70, the control unit 30 analyzesNFC information (the NFC information of the second time), and determineswhether the NFC information includes information indicating the printfunction or includes information indicating the scan function. In thecase where it is determined that the NFC information includesinformation indicating the print function, the process proceeds to S72.In the case where it is determined that the NFC information includesinformation indicating the scan function, the process proceeds to S76.

In S72, the size determining unit 47 determines whether the amount ofspace within the memory 34 is equal to or greater than the data size ofthe print data. As described above, in the case where the print functionis determined in S70, the NFC information includes the size informationindicating the data size of the print data. In S72 the size determiningunit 47 analyzes the NFC information, and identifies the sizeinformation. Next, the size determining unit 47 determines whether theamount of space within the memory 34 is equal to or greater than thedata size of the print data indicated by the size information.

In the case where it is determined that the amount of space within thememory 34 is equal to or greater than the data size of the print data(YES in S72), the re-request process of FIG. 4 ends as “normal END”. Onthe other hand, in the case where it is determined that the amount ofspace within the memory 34 is less than the data size of the print data(NO in S72), the process proceeds to S74.

In S74 the sending unit 46 sends print NG information including the NGreason to the portable terminal 50 via the NFC I/F 22. The NG reasonindicates that the amount of space within the memory 34 is less than thedata size of the print data. In the case where S74 has ended, there-request process of FIG. 4 ends as “error END”. Moreover, in thiscase, the portable terminal 50 displays a screen on the displaying unitof the portable terminal 50, this indicating a shortage of the amount ofspace within the memory 34 of the MFP 10, without sending additional NFCinformation to the MFP 10.

Moreover, in the case where the scan function is determined in S70, inS76 the function executing unit 43 activates a scan monitoring thread.As will be described in detail later, in the scan monitoring thread, inthe case where the state of the MFP 10 shifts from the error state tothe non-error state, the function executing unit 43 executes the scanfunction including the scan process in which a scan of the document isexecuted and scan data is created, and the communication process inwhich the scan data is sent to the portable terminal 50 via the wirelessLAN I/F 20.

In the case where the normal request process of S14 of FIG. 2, or there-request process of S16 ends, in S18 the changing unit 42 determineswhether the process of S14 or S16 ended as “normal END”. In the casewhere the process of S14 or S16 ended as “normal END”, the changing unit42 determines YES in S18, and executes the change process of S20. On theother hand, in the case where the process of S14 or S16 ended as “errorEND”, the changing unit 42 determines NO in S18, and the process returnsto S10 without the change process of S20 being executed (further,without the processes from S22 onwards being executed).

(Change Process; FIG. 5)

The contents of the change process executed in S20 of FIG. 2 will bedescribed with reference to FIG. 5. The change process is a process forchanging the interface through which the MFP 10 executes communicationwith the portable terminal 50 from the NFC I/F 22 to the wireless LANI/F 20.

In S100 the changing unit 42 determines whether the MFP 10 currentlybelongs to a wireless network. S100 is the same as S54 of FIG. 3. In thecase where the changing unit 42 determines that the MFP 10 currentlybelongs to a wireless network (YES in S100), the process proceeds toS102, and in the case where the changing unit 42 determines that the MFP10 does not belong to a wireless network (NO in S100), the processproceeds to S104.

In S102, the changing unit 42 determines whether the MFP 10 and theportable terminal 50 belong to an identical wireless network. S102 isthe same as S56 of FIG. 3. In the case where the changing unit 42determines that the MFP 10 and the portable terminal 50 belong to anidentical wireless network (YES in S102), the process proceeds to S120,and in the case where the changing unit 42 determines that the MFP 10and the portable terminal 50 do not belong to an identical wirelessnetwork (NO in S102), the process proceeds to S 104.

As described in S56 of FIG. 3, in S104 the changing unit 42 executes adetermination by using the SSID and BSSID of the wireless network towhich the portable terminal 50 currently belongs. Consequently, thechanging unit 42 can appropriately execute the change process by usingthe SSID and BSSID included in the NFC information.

In S120 the changing unit 42 sends information indicating settingshifting is unnecessary to the portable terminal 50 via the NFC I/F 22.Thereby, the portable terminal 50 can learn that it is not necessary tochange the current wireless setting of the portable terminal, i.e., thatthe wireless network to which the portable terminal 50 currently belongs(the normal Wi-Fi network or the WFD network) may continue to be used.

Moreover, in the change process which is executed after S76 of FIG. 4,the changing unit 42 determines YES in S100 and S102, and must executeS120. This is because S76 of FIG. 4 is executed only in the case whereYES was determined in S54 and S56 of FIG. 3 (i.e., in the case where theMFP 10 and the portable terminal 50 belong to the identical wirelessnetwork). In the case where S120 ends, the change process of FIG. 5 endsas “normal END”.

In S104 the changing unit 42 determines whether the WFD I/F settingwithin the memory 34 is ON or OFF. In the case where the WFD I/F settingis ON (YES in S104), the changing unit 42 proceeds to S106, and in thecase where the WFD I/F setting is OFF (NO in S104), the changing unit 42proceeds to S108.

In S108, without receiving an instruction from the user of the MFP 10,the changing unit 42 changes the WFD I/F setting within the memory 34from OFF to ON. Thereby, the control unit 30 becomes able to executeprocesses in accordance with the WFD system (processes S114 to S118 (tobe described), etc.). When S108 ends, the process proceeds to S114.

Moreover, since the WFD I/F setting is ON at the stage of executingS106, the MFP 10 is operating in one of the three states of the WFDsystem (G/O state, client state, and device state). Consequently, thememory 34 is storing a value (called “state value” below) indicating thestate of the MFP 10 relating to the WFD system (G/O state, client stateor device state).

In S106 the changing unit 42 determines whether the MFP 10 is operatingin the client state. Specifically, the changing unit 42 determineswhether the state value within the memory 34 is a value indicating theclient state. In the case where the state value is a value indicatingthe client state (YES in S106), the changing unit 42 ends the changeprocess as “error END” without continuously executing the changeprocess. On the other hand, in the case where the state value is a valueindicating the G/O state or device state (NO in S106), the changing unit42 proceeds to S110 (i.e., executes the change process continuously).

In S110 the changing unit 42 determines whether the MFP 10 is operatingin the G/O state. Specifically, the changing unit 42 determines whetherthe state value within the memory 34 is a value indicating the G/Ostate. In the case where the state value is a value indicating the G/Ostate (YES in S110), the changing unit 42 proceeds to S112, and in thecase where the state value is a value indicating the device state (NO inS110), the changing unit 42 proceeds to S114.

In S112 the changing unit 42 determines whether the number ofapparatuses other than the MFP 10 which are included in the WFD networkin which the MFP 10 is operating in the G/O state is less than apredetermined maximum client number. Specifically, in the case where thenumber of identification information of apparatuses (i.e., client stateapparatuses) registered in the administration list within the memory 34is equal to or greater than the maximum client number, the changing unit42 determines NO in S112, and ends the change process as “error END”without executing the change process continuously. On the other hand, inthe case where the above number is less than the maximum client number,the changing unit 42 determines YES in S112, and proceeds to S116 (i.e.,executes the change process continuously).

In S114 the changing unit 42 sets the MFP 10 to spontaneous G/O mode.The spontaneous G/O mode is a mode which keeps the MFP 10 operating inthe G/O state. Consequently, the MFP 10 is set to the G/O state (i.e.,the state value within the memory 34 is a value indicating the G/Ostate) although a WFD connection has not been established at the stageof S114. In the case where the MFP 10 is set to the G/O state, thechanging unit 42 prepares the wireless setting (SSID, BSSID,authentication method, encryption method, password, etc.) to be used inthe WFD network. Moreover, the authentication method and the encryptionmethod are predetermined. Further, the changing unit 42 creates thepassword. Moreover, the SSID may be created by the changing unit 42, ormay be predetermined. The BSSID is the MAC address for WFD of the MFP10. The changing unit 42 stores the wireless setting created in S114 inthe memory 34. Moreover, at this stage, identification information ofthe client state apparatus is not described in the administration listwithin the memory 34.

Next, in S116 the changing unit 42 sends the wireless setting within thememory 34 to the portable terminal 50 via the NFC I/F 22. Moreover, inS116, which is executed after S114, the wireless setting within thememory 34 is the wireless setting created in S114. Further, in S116,which is executed after YES in S112, the wireless setting within thememory 34 is a wireless setting created when it was determined in thepast that the MFP 10 is operating in the G/O state. Thereby, theportable terminal 50 can use the same wireless setting as the MFP 10.

Next, in S118 the changing unit 42 establishes a WFD connection with theportable terminal 50. Specifically, the changing unit 42 executesspecific wireless communication with the portable terminal 50 via thewireless LAN I/F 20. The specific wireless communication includes anAuthentication Request, Authentication Response, Association Request,Association Response, and 4way handshake. Various authenticationprocesses such as authentication of SSID, authentication ofauthentication method and encryption method, authentication of password,etc. are executed during the course of the specific wirelesscommunication. In case all the authentications succeeded, a WFDconnection is established between the MFP 10 and the portable terminal50.

Moreover, in the case where both the MFP 10 and the portable terminal 50were in the device state, when a WFD connection were to be establishedbetween the MFP 10 and the portable terminal 50, G/O negotiation wouldbe executed to determine one of the MFP 10 and the portable terminal 50as the G/O and to determine the other of the MFP 10 and the portableterminal 50 as the client. However, since it is ascertained that the MFP10 is in the G/O state at the stage of executing S 118, the changingunit 42 establishes the WFD connection with the portable terminal 50without executing the G/O negotiation.

When the WFD connection is established between the MFP 10 and theportable terminal 50, the changing unit 42 further adds the MAC addressof the portable terminal 50 to the administration list. Moreover, thechanging unit 42 acquires the MAC address of the portable terminal 50during the course of the specific wireless communication of S118. Whenthe WFD connection between the MFP 10 and the portable terminal 50 hasbeen established, the MFP 10 that is in the G/O state becomes able tocommunicate object data (print data, scan data, etc.) with the portableterminal 50 that is in the client state. Moreover, the object dataincludes network layer data, which is a layer higher than the physicallayer of the OSI reference model. Consequently, the MFP 10 that is inthe G/O state can execute wireless communication of the network layerwith the portable terminal 50 that is in the client state. In the casewhere S118 ends, the change process of FIG. 5 ends as “normal END”.

(Continuation of MFP Process of FIG. 2)

In the case where the change process (FIG. 5) of S20 of FIG. 2 ends, inS22 the sending unit 46 determines whether the change process of S20ended as “normal END”. In the case where the change process of S20 endedas “normal END”, the sending unit 46 determines YES in S22, and proceedsto S26. On the other hand, in the case where the change process of S20ended as “error END”, the sending unit 46 determines NO in S22, andproceeds to S24.

In S24 the sending unit 46 sends communication NG information to theportable terminal 50 via the NFC I/F 22. The communication NGinformation includes the NG reason indicating that the wirelesscommunication of the object data cannot be executed. Moreover, in thecase where the portable terminal 50 receives the communication NGinformation, without sending the NFC information including informationindicating a re-request (the NFC information of the second time) to theMFP 10, the portable terminal 50 displays a screen on the displayingunit of the portable terminal 50 indicating that the wirelesscommunication of the object data cannot be executed.

Next, in S26 the function executing unit 43 executes a functionexecuting process including a communication process. In the case wherethe NFC information received in S10 includes information indicating theprint function, in S26 the function executing unit 43 first executes acommunication process for receiving print data from the portableterminal 50 via the wireless LAN I/F 20. Next, the function executingunit 43 executes the print process in accordance with print data. Thatis, the function executing unit 43 executes various processes (colorconversion process, halftone process, etc.) on the print data,generating processed data, and then supplies the processed data to theprint executing unit 16. Thereby, the print executing unit 16 prints animage on a print medium in accordance with the processed data.

Further, in the case where the NFC information received in S10 includesinformation indicating the scan function, in S26 the function executingunit 43 first executes a scan process. That is, the function executingunit 43 causes the scan executing unit 18 to scan a document that hasbeen set on the scan executing unit 18. The function executing unit 43acquires the original image data obtained by scanning, and executesvarious processes (correction process, etc.) on the original image data,creating scan data. Next, the function executing unit 43 executes acommunication process for sending the scan data to the portable terminal50 via the wireless LAN I/F 20.

Moreover, in S26, which is executed after YES in S72 of FIG. 4, thefunction executing unit 43 executes a communication process forreceiving the print data, and stores the print data in the memory 34,but does not execute the print process. In this case, the functionexecuting unit 43 activates the print monitoring thread. Further, in thecase where S76 of FIG. 4 was executed (i.e., the case where the scanmonitoring thread was activated), the function executing unit 43 skipsthe process S26.

Next, in S28 the changing unit 42 determines whether the process S108 ofFIG. 5 (the process of changing the WFD I/F setting from OFF to ON) wasexecuted in the change process of S20. In the case where the processS108 was executed (YES in S28), in S30 the changing unit 42 changes theWFD I/F setting from ON to OFF. Thereby, in the case where the changingunit 42 changed the WFD I/F setting to ON without receiving aninstruction from the user, the changing unit 42 can return the WFD I/Fsetting to its setting prior to changing (i.e., OFF). In this case, theWFD connection established in S118 of FIG. 5 is disconnected, and theWFD network ceases to exist.

Moreover, in the case where the process S108 was not executed (NO inS28), the changing unit 42 skips S30. In the case of NO in S28, or inthe case where S30 has ended, the process returns to S10.

(Print Monitoring Thread)

As described above, the print monitoring thread can be activated in S26of FIG. 2. In the print monitoring thread, the function executing unit43 monitors whether the state of the MFP 10 has changed from the printincapable state to the print capable state. In the case where the userof the MFP 10 has removed the cause of the MFP 10 assuming the printincapable state (e.g., has closed the cover member, has removed theprint medium jammed in the transport path of the print medium, hasreplenished the expendable item or print medium, etc.), the functionexecuting unit 43 determines that the state of the MFP 10 has changed tothe print capable state. In the case of determining that the state ofthe MFP 10 has changed to the print capable state, the functionexecuting unit 43 executes the print process in accordance with theprint data within the memory 34.

(Scan Monitoring Thread)

As described above, the scan monitoring thread can be activated in S76of FIG. 4. In the scan monitoring thread, the function executing unit 43monitors whether the state of the MFP 10 has changed from the scanincapable state to the scan capable state. In the case where the user ofthe MFP 10 has removed the cause of the MFP 10 assuming the scanincapable state (e.g., has closed the cover member, has removed thedocument jammed in the automatic document feeder, etc.), the functionexecuting unit 43 determines that the state of the MFP 10 has changed tothe scan capable state. In the case of determining that the state of theMFP 10 has changed to the scan capable state, the function executingunit 43 executes the scan process for creating scan data. Next, thefunction executing unit 43 executes a communication process for sendingthe scan data to the portable terminal 50 via the wireless LAN I/F 20.

Next, specific cases realized by the MFP 10 and the portable terminal 50will be described with reference to FIG. 6 to FIG. 13. The cases of FIG.6 to FIG. 13 are realized by the MFP 10 executing the processes of FIG.2 to FIG. 5.

(Case A; FIG. 6)

In case A, the state of the MFP 10 is the non-error state (i.e., theprint capable state and the scan capable state), and print function “OK”and scan function “OK” are associated with the terminal ID “ID 50” inthe SFL information 36.

The MFP 10 receives NFC information from the portable terminal 50 viathe NFC I/F 22 (YES in S10 of FIG. 2). The NFC information includesinformation indicating a normal request. For example, in the case wherethe NFC information includes information indicating the print function(called “printing case” below), the MFP 10 determines YES in S42 of FIG.3, and determines YES in S44. Further, e.g., in the case where the NFCinformation includes information indicating the scan function (called“scanning case” below), the MFP 10 determines YES in S48 of FIG. 3, anddetermines YES in S52. In both the printing case and the scanning case,the normal request process ends as “normal END”.

Next, the MFP 10 executes the change process S20 of FIG. 2. Thereby,communication is executed to change the interface, which is to be usedfor communication between the MFP 10 and the portable terminal 50, fromthe NFC I/F to the wireless LAN I/F (S116 to S120 of FIG. 5; called“communication for changing I/F” below). Moreover, in the communicationfor changing I/F, communication via the NFC I/F 22 may be executed(S116, S120 of FIG. 5), and communication via the wireless LAN I/F 20may be executed (S 118 of FIG. 5). Consequently, “NFC” and “wirelessLAN” are both written at the left side of the change process of FIG. 6.

In the printing case, the MFP 10 executes a communication process forreceiving the print data from the portable terminal 50 via the wirelessLAN I/F 20 (S26), and then executes the print process in accordance withthe print data (S26). Thereby, the MFP 10 can execute the print functionin accordance with the instruction from the portable terminal 50.

Further, in the scanning case, the MFP 10 executes the scan process forcreating the scan data (S26), and then executes a communication processto send the scan data to the portable terminal 50 via the wireless LANI/F 20 (S26). Thereby, the MFP 10 can execute the scan function inaccordance with the instruction from the portable terminal 50.

(Case X1; FIG. 7)

Cases X1 to X4 of FIG. 7 to FIG. 10 show examples of communication forchanging I/F. In case X1, the MFP 10 and the portable terminal 50already belong to an identical wireless network (WFD network or normalWi-Fi network) at the time the communication of NFC information isexecuted.

The MFP 10 determines YES in S100 of FIG. 5, and determines YES in S102.Consequently, in S120 the MFP 10 sends the information indicatingsetting shifting is unnecessary to the portable terminal 50 via the NFCI/F 22. In this case, the MFP 10 executes the communication of objectdata (print data or scan data) with the portable terminal 50 via thewireless LAN I/F 20 by using the existing wireless network (S26 of FIG.2).

(Case X2; FIG. 8)

In case X2, the MFP 10 and the PC 8 have constructed a WFD network, andthe MFP 10 is operating in the G/O state. Moreover, the portableterminal 50 does not belong to the WFD network.

The MFP 10 determines YES in S100 of FIG. 5, determines NO in S102,determines YES in S104, determines NO in S106, determines YES in S110,and determines YES in S 112. Consequently, in S116 the MFP 10 sends awireless setting for the portable terminal 50 to join the WFD network(i.e., a wireless setting created at the time the MFP 10 became the G/O)to the portable terminal 50 via the NFC I/F 22. Next, in S118 the MFP 10establishes a WFD connection with the portable terminal 50 via thewireless LAN I/F 20.

Thereby, the portable terminal 50 can newly join the WFD network towhich the MFP 10 and the PC 8 belong. In this case, by using the WFDnetwork, the MFP 10 executes the communication of object data (printdata or scan data) with the portable terminal 50 via the wireless LANI/F 20 (S26 of FIG. 2).

(Case X3; FIG. 9)

In case X3, the MFP 10 does not belong to a wireless network, and theMFP 10 is operating in the device state (i.e., the WFD I/F setting isON). Moreover, the portable terminal 50 also does not belong to awireless network.

The MFP 10 determines NO in S100 of FIG. 5, determines YES in S104,determines NO in S106, and determines NO in S110. Consequently, in S114the MFP 10 is set to the spontaneous G/O mode. At this juncture, the MFP10 creates a wireless setting to be used in the newly constructed WFDnetwork. Next, in S 116, the MFP 10 sends a wireless setting for theportable terminal 50 to join the WFD network (i.e., the wireless settingcreated by the MFP 10 in S114) to the portable terminal 50 via the NFCI/F 22. Next, in S118 the MFP 10 establishes a WFD connection with theportable terminal 50 via the wireless LAN I/F 20.

Thereby, a new WFD network is constructed that includes the MFP 10 andthe portable terminal 50. In this case, by using the WFD network, theMFP 10 executes the communication of object data (print data or scandata) with the portable terminal 50 via the wireless LAN I/F 20 (S26 ofFIG. 2).

(Case X4; FIG. 10)

In case X4, the MFP 10 does not belong to a wireless network, and theWFD I/F setting of the MFP 10 is OFF. Moreover, the portable terminal 50also does not belong to a wireless network.

The MFP 10 determines NO in S100 of FIG. 5, and determines NO in S104.Consequently, in S108 the MFP 10 changes the WFD I/F setting from OFF toON. Next, in S114 the MFP 10 is set to the spontaneous G/O mode. At thisjuncture, the MFP 10 creates a wireless setting to be used in the newlyconstructed WFD network. Next, in S116 the MFP 10 sends a wirelesssetting for the portable terminal 50 to join the WFD network (i.e., thewireless setting created by the MFP 10 in S114) to the portable terminal50 via the NFC I/F 22. Next, in S118 the MFP 10 establishes a WFDconnection with the portable terminal 50 via the wireless LAN I/F 20.

Thereby, a new WFD network is constructed that includes the MFP 10 andthe portable terminal 50. In this case, by using the WFD network, theMFP 10 executes the communication of object data (print data or scandata) with the portable terminal 50 via the wireless LAN I/F 20 (S26 ofFIG. 2).

Next, the MFP 10 determines YES in S28 of FIG. 2, and in S30 changes theWFD I/F setting from ON to OFF. Thereby, the WFD network ceases toexist. This is because the G/O ceases to be present. That is, the WFDnetwork is a wireless network constructed temporarily for thecommunication process of S26 of FIG. 2.

(Case B; FIG. 11)

In case B, the state of the MFP 10 is the non-error state (i.e., theprint capable state and the scan capable state) and, in the SFLinformation 36, print function “OK” is associated with the terminal ID“ID 50”, and scan function “NG” is associated with the terminal ID “ID50”.

The MFP 10 receives NFC information from the portable terminal 50 viathe NFC I/F 22 (YES in S10 of FIG. 2). The NFC information includesinformation indicating a normal request and information indicating theprint function. In this case, as in case A of FIG. 6, the MFP 10executes the change process (S20 of FIG. 2), executes a communicationprocess for receiving the print data (S26), and then executes the printprocess in accordance with the print data (S26). Thereby, the MFP 10 canexecute the print function in accordance with the instruction from theportable terminal 50.

Next, the MFP 10 receives NFC information from the portable terminal 50via the NFC I/F 22 (YES in S10 of FIG. 2). The NFC information includesinformation indicating a normal request and information indicating thescan function. In this case, the MFP 10 determines NO in S48 of FIG. 3and, in S50, sends the scan NG information to the portable terminal 50via the NFC I/F 22.

Consequently, the normal request process ends as “error END”. Thereby,the MFP 10 determines NO in S18 of FIG. 2, and does not execute thechange process of S20. Further, the portable terminal 50 receives thescan NG information that includes the NG reason due to SFL, andconsequently does not send NFC information including informationindicating a re-request to the MFP 10.

(Case C; FIG. 12)

In case C, the state of the MFP 10 is the error state (i.e., the printincapable state due to cover open), and print function “OK” isassociated with the terminal ID “ID 50” in the SFL information 36.

The MFP 10 receives NFC information from the portable terminal 50 viathe NFC I/F 22 (YES in S10 of FIG. 2). The NFC information includesinformation indicating a normal request and information indicating theprint function. The MFP 10 determines YES in S42 of FIG. 3, anddetermines NO in S44. In this case, in S46 the MFP 10 sends the print NGinformation including the NG reason indicating cover open to theportable terminal 50 via the NFC I/F 22.

Consequently, the normal request process ends as “error END”. Thereby,the MFP 10 determines NO in S18 of FIG. 2, and does not execute thechange process of S20. On the other hand, upon receiving the print NGinformation from the MFP 10, the portable terminal 50 sends, to the MFP10, NFC information including at least information indicating are-request, information indicating the print function, and the sizeinformation indicating the data size of the print data.

The MFP 10 receives the NFC information from the portable terminal 50via the NFC I/F 22 (YES in S10 of FIG. 2). In the case where the amountof space of the memory 34 is equal to or greater than the data size ofthe print data, the MFP 10 determines YES in S72 of FIG. 4.

Consequently, the re-request process ends as “normal END”. Thereby, theMFP 10 determines YES in S18 of FIG. 2, executes the change process ofS20, and executes a communication process for receiving the print data(S26). The MFP 10 stores the print data in the memory 34, then activatesthe print monitoring thread (S26). In the case where the state of theMFP 10 has changed from the print incapable state to the print capablestate, in the print monitoring thread the MFP 10 executes the printprocess in accordance with the print data. Thereby, the MFP 10 canexecute the print function in accordance with the instruction from theportable terminal 50.

On the other hand, in the case where the amount of space of the memory34 is less than the data size of the print data, the MFP 10 determinesNO in S72 of FIG. 4. In this case, in S74 the MFP 10 sends the print NGinformation including the NG reason, this indicating a shortage of theamount of space of the memory 34, to the portable terminal 50 via theNFC I/F 22.

Consequently, the re-request process ends as “error END”. Thereby, theMFP 10 determines NO in S18 of FIG. 2, and does not execute the changeprocess of S20. Further, since the portable terminal 50 receives theprint NG information including the NG reason indicating a shortage ofthe amount of space of the memory 34, the portable terminal 50 does notsend NFC information including information indicating a re-request tothe MFP 10.

(Case D; FIG. 13)

In case D, the state of the MFP 10 is the error state (i.e., the scanincapable state due to cover open), and scan function “OK” is associatedwith the terminal ID “ID 50” in the SFL information 36. Moreover, theMFP 10 and the portable terminal 50 belong to an identical WFD or normalWi-Fi wireless network.

The MFP 10 receives NFC information from the portable terminal 50 viathe NFC I/F 22 (YES in S10 of FIG. 2). The NFC information includesinformation indicating a normal request and information indicating thescan function. The MFP 10 determines YES in S48 of FIG. 3 and determinesNO in S52. The MFP 10 and the portable terminal 50 already belong to anidentical wireless network at the time the communication of NFCinformation is executed. Consequently, the MFP 10 determines YES in S54,and determines YES in S56. In this case, in S58 the MFP 10 sends scan NGinformation including the NG reason indicating cover open and the NWidentical information to the portable terminal 50 via the NFC I/F 22.

Consequently, the normal request process ends as “error END”. Thereby,the MFP 10 determines NO in S18 of FIG. 2, and does not execute thechange process of S20. On the other hand, when the portable terminal 50receives the scan NG information from the MFP 10, the portable terminal50 sends, to the MFP 10, NFC information including at least informationindicating a re-request and information indicating the scan function.

The MFP 10 receives NFC information from the portable terminal 50 viathe NFC I/F 22 (YES in S10 of FIG. 2). In this case, in S76 of FIG. 4the MFP 10 activates the scan monitoring thread.

Consequently, the re-request process ends as “normal END”. Thereby, theMFP 10 determines YES in S18 of FIG. 2, and executes the change processof S20. However, in the change process of S20, the MFP 10 determines YESin S102 of FIG. 5. This is because the MFP 10 and the portable terminal50 belong to an identical wireless network. Consequently, in S120 theMFP 10 sends the information indicating setting shifting is unnecessaryto the portable terminal 50 via the NFC I/F 22. Moreover, in this case,the MFP 10 skips process S26 of FIG. 2.

In the case where the state of the MFP 10 changes from the scanincapable state to the scan capable state, in the scan monitoring threadthe MFP 10 executes the scan process, and then executes a communicationprocess for sending scan data. Thereby, the MFP 10 can execute the scanfunction in accordance with the instruction from the portable terminal50.

Moreover, although not shown as a specific case, in the case where theterminal ID “ID 50” included in the NFC information sent to the MFP 10from the portable terminal 50 is not registered in the SFL information36 (i.e., the ID-function information), the MFP 10 determines NO in S42or S48 of FIG. 3, and sends, to the portable terminal 50, print NGinformation or scan NG information including the NG reason due to SFL.In this case, the normal request process ends as “error END”. Thereby,the MFP 10 determines NO in S18 of FIG. 2, and does not execute thechange process of S20. Further, the portable terminal 50 receives theprint NG information or scan NG information including the NG reason dueto SFL, and consequently does not send NFC information includinginformation indicating a re-request to the MFP 10.

Result of Present Embodiment

As described above, in the case of receiving NFC information from theportable terminal 50 via the NFC I/F 22, the MFP 10 determines whetherthe state of the MFP 10 is the non-error state or the error state (S44,S52 of FIG. 3). As shown in case A of FIG. 6, in the case of determiningthat the state of the MFP 10 is the non-error state, the MFP 10 executesthe change process S20 of FIG. 2, and can appropriately execute thecommunication of the object data (print data or scan data) with theportable terminal 50 via the wireless LAN I/F 20. Consequently, the MFP10 can appropriately execute the print function or scan function inaccordance with the instruction from the portable terminal 50. On theother hand, as shown in cases C, D of FIGS. 12, 13, in the case ofdetermining that the state of the MFP 10 is the error state, the MFP 10does not execute the change process S20 of FIG. 2. Thereby, thesituation can be prevented from occurring in which the change process isexecuted even though the state of the MFP 10 is the error state.Thereby, the processing load of the MFP 10 can be reduced. Thus, the MFP10 can execute an appropriate operation in accordance with thedetermination results relating to the state of the MFP 10.

Further, in the case of receiving NFC information from the portableterminal 50 via the NFC I/F 22, the MFP 10 determines whether theportable terminal 50 is capable of using a function (S42, S48 of FIG.3). As shown in case B of FIG. 11, in the case of determining that theNFC information includes information indicating the print function andthat the portable terminal 50 is capable of using the print function(YES in S42 of FIG. 3), the MFP 10 executes the change process S20 ofFIG. 2, and can appropriately execute the communication of the printdata with the portable terminal 50 via the wireless LAN I/F 20.Consequently, the MFP 10 can appropriately execute the print function inaccordance with the instruction from the portable terminal 50. On theother hand, in the case of determining that the NFC information includesinformation indicating the scan function and that the portable terminal50 is not capable of using the scan function (NO in S48 of FIG. 3), theMFP 10 does not execute the change process S20 of FIG. 2. Thereby, thesituation can be prevented from occurring in which the change process isexecuted even though the portable terminal 50 is not capable of usingthe scan function. Thereby, the processing load of the MFP 10 can bereduced. Thus, the MFP 10 can execute an appropriate operation inaccordance with the determination results relating to the functions usedby the portable terminal 50.

(Corresponding Relationships)

The MFP 10 is an example of the “function executing device”. Theportable terminal 50 is an example of the “terminal device”. The NFC I/F22 and the wireless LAN I/F 20 are respectively examples of the “firsttype of interface” and the “second type of interface”. Further, the“print function” and the “scan function” in case B of FIG. 11 arerespectively examples of the “first function” and the “second function”.The NFC information including information indicating a normal request isan example of the “first information”. The SSID and BSSID included inthis NFC information are examples of the “relation information”.Further, the NFC information including information indicating are-request and information indicating the print function, and the NFCinformation including information indicating a re-request andinformation indicating the scan function are respectively examples ofthe “second information” and the “third information”. Further, the SFLinformation 36 (i.e., the ID-function information and the publicinformation) is an example of the “permission information”. The print NGinformation and the scan NG information are examples of the“impossibility information”. The G/O state and the client state arerespectively examples of the “parent station state” and the “childstation state”. S112 of FIG. 5 is an example of the “apparatus numberdetermining process”.

(Variant 1)

The “function executing device” is not restricted to the multi-functionperipheral capable of executing the print function and the scanfunction, but may be a printer capable of executing only the printfunction from among the print function and the scan function, or may bea scanner capable of executing only the scan function from among theprint function and the scan function. Further, the “function executingdevice” may be a device (e.g., a PC, server, mobile phone, Smart Phone,etc.) that executes a function different from the print function and thescan function (e.g., an image display function, data calculationfunction).

(Variant 2)

The “specific function” may be the “print function” or “scan function”,as in case A of FIG. 6, or may be a function different from the printfunction and the scan function. For example, in the case where thedifferent function is the image display function, the image datarepresenting the image is an example of the “object data”. Further,e.g., in the case where the different function is the data calculationfunction, the data that is the calculation target is an example of the“object data”.

(Variant 3)

The combination of the “first type of interface” and the “second type ofinterface” is not restricted to the combination of the NFC I/F and thewireless LAN I/F. For example, in the case where the wireless LAN I/F isadopted as the “second type of interface”, the “first type of interface”may be an interface for executing infrared communication, an interfacefor executing Bluetooth (registered trademark), or an interface forexecuting Transfer Jet. Further, in the case where the NFC I/F isadopted as the “first type of interface”, the “second type of interface”may be an interface for executing wired communication, or an interfacefor executing Bluetooth (registered trademark). In general terms, thecombination of the interfaces may be any combination whereby thecommunication speed of communication via the second type of interface isfaster than the communication speed of communication via the first typeof interface.

(Variant 4)

The “first type of interface” and the “second type of interface” mayphysically be two interfaces (i.e., two separate IC chips), as in theabove embodiment, or may physically be one interface (i.e., two types ofcommunication are realized with one IC chip).

(Variant 5)

The “change process” is not restricted to the processes of FIG. 5, butincludes any process for changing the interface for communicating withthe portable terminal from the first type of interface to the secondtype of interface. For example, the following processes can beillustrated.

(Variant 5-1)

For example, in the case of YES in S106 of FIG. 5 (i.e., the case wherethe MFP 10 is in the client state), the changing unit 42 may change thestate of the MFP 10 from the client state to the device state (i.e.,disconnect the MFP 10 from the WFD network), and then proceed to S114(spontaneous G/O mode) (an example of the “change process”).

(Variant 5-2)

For example, in the case of YES in S106 of FIG. 5 (i.e., the case wherethe MFP 10 is in the client state), the changing unit 42 may send thewireless setting being used in the WFD network to which the MFP 10currently belongs (i.e., a wireless setting created by a G/O apparatusdifferent from the MFP 10) to the portable terminal 50 via the NFC I/F22 (an example of the “change process”). Thereby, the portable terminal50 can establish a WFD connection with the G/O apparatus (i.e., can jointhe WFD network). Consequently, the function executing unit 43 canexecute the object data communication process with the portable terminal50 via the G/O apparatus.

(Variant 5-3)

For example, in the case of YES in S100 of FIG. 5 (i.e., the case wherethe MFP 10 currently belongs to a wireless network) and the wirelessnetwork to which the MFP 10 belongs is a normal Wi-Fi networkconstructed by the AP 6, the changing unit 42 may send the wirelesssetting being used in the normal Wi-Fi network (i.e., the wirelesssetting created by the AP 6) to the portable terminal 50 via the NFC I/F22 (an example of the “change process”). Thereby, the portable terminal50 can establish a normal Wi-Fi connection with the AP 6 (i.e., can jointhe normal Wi-Fi network). Consequently, the function executing unit 43can execute the object data communication process with the portableterminal 50 via the AP 6.

(Variant 5-4)

For example, the NFC information may include the wireless setting thatis being used in the wireless network (WFD network or normal Wi-Finetwork) to which the portable terminal 50 currently belongs. Forexample, in the case of NO in S100 of FIG. 5 (i.e., the case where theMFP 10 does not belong to a wireless network), or in the case of NO inS102 (i.e., the case where the MFP 10 and the portable terminal 50 donot belong to an identical network), the changing unit 42 may newly jointhe wireless network to which the portable terminal 50 currently belongsby using the wireless setting in the NFC information (an example of the“change process”). In this case, the function executing unit 43 canexecute the object data communication process with the portable terminal50 by using the wireless network which was newly joined.

(Variant 5-5)

For example, the NFC information may include the IP address of theportable terminal 50 that is being used in the wired network to whichthe portable terminal 50 currently belongs. For example, in the casewhere an interface for executing wired communication has been adopted asthe “second type of interface”, the changing unit 42 may sendinformation indicating the execution of wired communication to theportable terminal 50 via the NFC I/F 22. In this case, the functionexecuting unit 43 can execute the object data communication process withthe portable terminal 50 via the wired network.

(Variant 6)

The normal request process of FIG. 3 may be configured such that, after“print function” is determined in S40, S42 is skipped, and the processproceeds to S44. Further, the normal request process of FIG. 3 may beconfigured such that, after “scan function” is determined in S40, S48and S50 are skipped, and the process proceeds to S52. That is, thecontrol unit 30 comprises the state determining unit 41 and may notcomprise the usage determining unit 45.

(Variant 7)

The normal request process of FIG. 3 may be configured such that, in thecase of YES in S42, S44 is skipped, and the process proceeds to “normalEND”. Further, the process may be configured such that, in the case ofYES in S48, S52 to S60 are skipped, and the process proceeds to “normalEND”. That is, the control unit 30 comprises the usage determining unit45 and may not comprise the state determining unit 41.

(Variant 8)

The “permission information” is not restricted to the SFL information36, but includes all information indicating whether the portableterminal is capable of using the specific function. For example, thefollowing information can be illustrated.

(Variant 8-1)

The memory 34 may store user-function information in which the followingare associated: the user ID, information indicating whether the printfunction is “OK” or “NG”, and information indicating whether the scanfunction is “OK” or “NG”. Instead of the terminal ID of the portableterminal 50, the NFC information may include the user ID of the user ofthe portable terminal 50. The usage determining unit 45 may determinewhether the user of the portable terminal 50 is capable of using aspecific function by using the user ID in the NFC information and theuser-function information. In the present variant, the user-functioninformation is an example of the “permission information”.

(Variant 8-2)

The memory 34 may store the user-function information and terminal-userinformation. The terminal-user information may be information in whichthe terminal ID and the user ID are associated. The NFC information mayinclude the terminal ID of the portable terminal 50. The usagedetermining unit 45 may identify the user ID by using the terminal ID inthe NFC information and the terminal-user information, and thendetermine whether the user of the portable terminal 50 is capable ofusing a specific function by using the identified user ID and theuser-function information. In the present variant, the combination ofthe user-function information and the terminal-user information is anexample of the “permission information”.

(Variant 8-3)

The memory 34 need not store the SFL information 36 in which theterminal ID and function OK or NG are associated. By operating theoperating unit 12, the user may be able to specify whether the SFLfunction of the MFP 10 is valid or invalid. Thereupon, the memory 34 maystore valid information in the case where SFL function=valid wasspecified, and store invalid information in the case where SFLfunction=invalid was specified. In this case, in the case where theinvalid information is being stored in the memory 34, the usagedetermining unit 45 may determine that the portable terminal 50 iscapable of using all the functions (i.e., the print function, the scanfunction) regardless of whether it does or does not receive the terminalID from the portable terminal 50 and, in the case where the validinformation is being stored in the memory 34, the usage determining unit45 may determine that the portable terminal 50 is not capable of usingany function. In the present variant, the valid information and theinvalid information are examples of the “permission information”.

(Variant 9)

In the above embodiment, the receiving unit 40 receives the NFCinformation that includes the information indicating the function (printfunction or scan function), and the relation information (SSID, BSSID)relating to the wireless network to which the portable terminal 50currently belongs by executing NFC system wireless communication oncewith the portable terminal 50. Instead, the receiving unit 40 mayreceive the NFC information including information indicating function byexecuting NFC system wireless communication with the portable terminal50, and may then receive the NFC information including the relationinformation by re-executing NFC system wireless communication with theportable terminal 50. That is, the “first information” including the“execution request of the function” and the “relation information” maybe information received by the NFC system wireless communication beingexecuted once, as in the above embodiment, or may be informationreceived by the NFC system wireless communication being executed aplurality of times, as in the present variant.

(Variant 10)

In the above embodiment, the receiving unit 40 receives the NFCinformation that includes the information indicating a re-request andthe size information indicating the data size of the print data byexecuting the NFC system wireless communication once with the portableterminal 50. Instead, the receiving unit 40 may receive the NFCinformation including information indicating a re-request by executingNFC system wireless communication with the portable terminal 50, and maythen receive the NFC information including the size information byre-executing NFC system wireless communication with the portableterminal 50. That is, the “second information” may be informationreceived by the NFC system wireless communication being executed once,as in the above embodiment, or may be information received by the NFCsystem wireless communication being executed a plurality of times, as inthe present variant.

(Variant 11)

In the above embodiment, the state determining unit 41 determineswhether the MFP 10 is in the print capable state using all threedecision criteria: the remaining amount of an expendable item, theremaining amount of print medium, and the state of hardware (S44 of FIG.3). Instead, the state determining unit 41 may execute a determinationusing only one decision criterion of the three decision criteria, or mayexecute a determination using only two decision criteria of the threedecision criteria. That is, the state determining unit 41 may execute adetermination using at least one decision criterion of the threedecision criteria.

(Variant 12)

In the above embodiment, the units 40 to 47 are realized by software.However, at least one of the units 40 to 47 may be realized by hardwaresuch as a logic circuit, etc.

1. A printer comprising: a wireless communication interface; a Wi-Ficommunication interface different from the wireless communicationinterface; a print executing unit; a processor; and a memory storinginstructions, wherein the instructions, when executed by the processor,cause the printer to perform: determining whether the printer is in anerror state, the error state being one or more of: a remaining amount ofan expendable item being equal to or less than a first threshold value,a remaining amount of print medium being equal to or less than a secondthreshold value, the print medium jammed in a transport mechanism of theprinter, an amount of space within a memory being less than a thirdthreshold value, and a cover member of the printer being open; in a casewhere a communication is performed with a terminal device via thewireless communication interface and it is determined that the printeris not in the error state, establishing a wireless connection with theterminal device via the Wi-Fi communication interface so as to form awireless network in which the printer is a parent state; receiving printdata from the terminal device via the Wi-Fi communication interface in acase where the wireless connection with the terminal device isestablished; and causing the print executing unit to print based on theprint data in a case where the print data is received, wherein in a casewhere a communication is performed with the terminal device via thewireless communication interface and it is determined that the printeris in the error state, a wireless connection with the terminal devicevia the Wi-Fi communication interface is not established.
 2. The printeras in claim 1, wherein the wireless communication interface isconfigured to send connection information to the terminal device, andthe wireless connection is established with the terminal device via theWi-Fi communication interface by using the connection information. 3.The printer as in claim 2, wherein the connection information includes awireless identifier, and the wireless connection is established with theterminal device via the Wi-Fi communication interface by using thewireless identifier.
 4. The printer as in claim 3, wherein the wirelessidentifier includes a Service Set Identifier (SSID).
 5. The printer asin claim 2, wherein the wireless communication interface is configuredto send connection information to the terminal device in response toreceiving a request from the terminal device via the wirelesscommunication interface.
 6. The printer as in claim 1, wherein thecommunication is performed with the terminal device via the wirelesscommunication interface when a distance between the printer and theterminal device becomes less than a communicable distance of thewireless communication interface.
 7. The printer as in claim 1, whereina communication speed of the Wi-Fi communication interface is fasterthan a communication speed of the wireless communication interface. 8.The printer as in claim 1, wherein the wireless communication interfaceis a Near Field Communication (NFC) interface.
 9. The printer as inclaim 1, wherein the wireless communication interface is a Bluetooth(registered trade mark) interface.
 10. The printer as in claim 1,wherein the printer is configured to operate in a parent state in a casewhere the communication is performed with the terminal device via thewireless communication interface.
 11. A communication device comprising:a wireless communication interface; a Wi-Fi communication interfacedifferent from the wireless communication interface; a processor; and amemory storing instructions, wherein the instructions, when executed bythe processor, cause the communication device to perform: in a situationwhere the communication device forms a wireless network in which thecommunication device operates in a parent station, determining whether anumber of one or more external devices participating in the wirelessnetwork is less than a threshold value, each of the one or more externaldevices operating in a child station in the wireless network; in a casewhere a communication is performed with a terminal device via thewireless communication interface and it is determined that the number ofone or more external devices is less than the threshold value,establishing a wireless connection with the terminal device via theWi-Fi communication interface so as to cause the terminal device toparticipate in the wireless network as a child station; and receivingobject data from the terminal device via the Wi-Fi communicationinterface in a case where the wireless connection with the terminaldevice is established, wherein in a case where a communication isperformed with the terminal device via the wireless communicationinterface and it is determined that the number of one or more externaldevices is equal to or more than the threshold value, a wirelessconnection with the terminal device via the Wi-Fi communicationinterface is not established.
 12. The communication device as in claim11, wherein the wireless communication interface is configured to sendconnection information to the terminal device, and the wirelessconnection is established with the terminal device via the Wi-Ficommunication interface by using the connection information.
 13. Thecommunication device as in claim 12, wherein the connection informationincludes a wireless identifier, and the wireless connection isestablished with the terminal device via the Wi-Fi communicationinterface by using the wireless identifier.
 14. The communication deviceas in claim 13, wherein the wireless identifier includes a Service SetIdentifier (SSID).
 15. The communication device as in claim 12, whereinthe wireless communication interface is configured to send connectioninformation to the terminal device in response to receiving a requestfrom the terminal device via the wireless communication interface. 16.The communication device as in claim 11, wherein the communication isperformed with the terminal device via the wireless communicationinterface when a distance between the communication device and theterminal device becomes less than a communicable distance of thewireless communication interface.
 17. The communication device as inclaim 11, wherein a communication speed of the Wi-Fi communicationinterface is faster than a communication speed of the wirelesscommunication interface.
 18. The communication device as in claim 11,wherein the wireless communication interface is a Near FieldCommunication (NFC) interface.
 19. The communication device as in claim11, wherein the wireless communication interface is a Bluetooth(registered trade mark) interface.
 20. The communication device as inclaim 11, further comprising: a print executing unit, wherein theinstructions, when executed by the processor, cause the communicationdevice to further perform: causing the print executing unit to printbased on the object data in a case where the object data is received.21. A non-transitory computer readable medium storing instruction for aprinter, the printer comprising: a wireless communication interface; aWi-Fi communication interface different from the wireless communicationinterface; a print executing unit; and a processor, wherein theinstructions, when executed by the processor, cause the printer toperform: determining whether the printer is in an error state, the errorstate being one or more of: a remaining amount of an expendable itembeing equal to or less than a first threshold value, a remaining amountof print medium being equal to or less than a second threshold value,the print medium jammed in a transport mechanism of the printer, anamount of space within a memory being less than a third threshold value,and a cover member of the printer being open; in a case where acommunication is performed with a terminal device via the wirelesscommunication interface and it is determined that the printer is not inthe error state, establishing a wireless connection with the terminaldevice via the Wi-Fi communication interface so as to form a wirelessnetwork in which the printer is a parent state; receiving print datafrom the terminal device via the Wi-Fi communication interface in a casewhere the wireless connection with the terminal device is established;and causing the print executing unit to print based on the print data ina case where the print data is received, in a case where a communicationis performed with the terminal device via the wireless communicationinterface and it is determined that the printer is in the error state, awireless connection with the terminal device via the Wi-Fi communicationinterface is not established.
 22. A non-transitory computer readablemedium storing instruction for a communication device, the communicationdevice comprising: a wireless communication interface; a Wi-Ficommunication interface different from the wireless communicationinterface; and a processor, wherein the instructions, when executed bythe processor, cause the communication device to perform: in a situationwhere the communication device forms a wireless network in which thecommunication device operates in a parent station, determining whether anumber of one or more external devices participating in the wirelessnetwork is less than a threshold value, each of the one or more externaldevices operating in a child station in the wireless network; in a casewhere a communication is performed with a terminal device via thewireless communication interface and it is determined that the number ofone or more external devices is less than the threshold value,establishing a wireless connection with the terminal device via theWi-Fi communication interface so as to cause the terminal device toparticipate in the wireless network as a child station; and receivingobject data from the terminal device via the Wi-Fi communicationinterface in a case where the wireless connection with the terminaldevice is established, wherein in a case where a communication isperformed with the terminal device via the wireless communicationinterface and it is determined that the number of one or more externaldevices is equal to or more than the threshold value, a wirelessconnection with the terminal device via the Wi-Fi communicationinterface is not established.